package com.example.consumer.controller;

import com.example.consumer.domain.Goods;
import com.example.consumer.feign.GoodsFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

/**
 * @Date: 2024/9/27
 * @Author: Administrator
 * @ClassName: OrderController
 * @Description: comment here
 */

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    GoodsFeign goodsFeign;

    @RequestMapping("/add/{id}")
    public Goods addGoods(@PathVariable("id") Integer id) {
        Goods goods = goodsFeign.addGoods(id);

        return goods;
    }
}
